Skip to content

Reuse UDP sender channels between messages - #1088

Open
sainadh777 wants to merge 1 commit into
apache:mainfrom
sainadh777:fix/tribes-udp-sender-keepalive
Open

sainadh777 wants to merge 1 commit into
apache:mainfrom
sainadh777:fix/tribes-udp-sender-keepalive

Conversation

@sainadh777

Copy link
Copy Markdown
Contributor

Summary

  • reuse UDP sender channels between messages instead of disconnecting after every send
  • apply the documented keepAliveCount and keepAliveTime limits to UDP senders
  • add focused regression coverage and remove the completed TODO item

Rationale

UDP senders are retained in the sender map, but AbstractSender.keepalive() currently closes their datagram channels after every message. Applying the existing keepalive policies avoids repeated channel creation while preserving configurable lifecycle bounds.

Validation

  • ant test -Dtest.entry=org.apache.catalina.tribes.transport.TestAbstractSenderKeepAlive — 2 tests, 0 failures, 0 errors, 0 skipped
  • ant validate — passed
  • ant clean deploy — passed
  • complete unfiltered ant clean test on Linux/OpenSSL — 42,214 tests across 743 suites, 0 failures, 0 errors, 362 environment-dependent skips
  • generated distribution start, root HTTP request returned 200, and clean stop — passed

The complete macOS run reached the end but the two OpenSSL cipher suites failed because /usr/bin/openssl is LibreSSL 3.3.6. The same unfiltered suite passed in Linux with OpenSSL.

@sainadh777

Copy link
Copy Markdown
Contributor Author

@rmaucher, could you review the UDP sender reuse change? You authored the latest direct AbstractSender update. @markt-asf, your review would also be valuable given your recent clustering and sender work in the same file.

@rmaucher

Copy link
Copy Markdown
Contributor

The UDP code never made it past "no keepalive" stage, so it is completely untested.
4aa6aff

@arturobernalg

Copy link
Copy Markdown
Member

-1

This introduces a regression when switching from UDP to TCP for the same cluster member.
ParallelNioSender reuses the same NioSender, but after a UDP send the channel remains connected. A subsequent TCP send fails with a NullPointerException because socketChannel is null.
I reproduced this with running Tomcat instances. All three UDP-to-TCP transitions succeeded on main, but failed with this change.
There also appears to be a resource leak: the UDP socket remains open after tomcat.stop().

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants